import request from '@/utils/request.js';

// 微信授权（注册）
export function wechatAuth(data){
	return request.post('spoken/user/register', data, true)
}

// 登录
export function wechatLogin(data){
	return request.post('spoken/user/login', data, true, '登录中')
}

// 获取手机号
export function getWechatPhone(data){
	return request.get('spoken/user/getPhoneNumber', data, true)
}

// 查询个人信息
export function getUserInfo(data){
	return request.get('spoken/user', data)
}

// 修改个人信息
export function setUserInfo(data){
	return request.put('spoken/user', data)
}

/**
 * 查询选择过的课时的日期
 */
export function getCourseDate(data){
	return request.get('spoken/user/courseTimeList', data)
}

/**
 * 根据日期查询课时详情
 */
export function getCourseTimeInfo(date){
	return request.get('spoken/user/courseTimeInfo/' + date, {}, true)
}

/**
 * 消课
 */
export function cancelLesson(id){
	return request.get('spoken/user/cancelLesson/' + id, {}, true)
}

/**
 * 请假
 */
export function leaveLesson(id){
	return request.get('spoken/user/leaveLesson/' + id, {}, true)
}
